An inverter that is used in an electric vehicle in many cases is equipped with a capacitor for smoothing direct current voltage of the main circuit. As a method for discharging charges stored in the capacitor that remains after the switch of the inverter is turned off, there is adopted a method of connecting a discharge resistor across both ends of the capacitor. However, this method leads to heat generation by the resistor due to continuously flowing current on the discharge resistor, and also leads to a deterioration of conversion efficiency of the inverter. Therefore, a method in which a switching element or the like is connected to the discharge resistor in series so that discharging can be started by switching the switching element to be conducting by a discharge command signal that is output only when discharge is required. For determining whether the discharge command signal should be output, a method of detecting a change in voltage across both ends of the capacitor with a differentiation circuit is used in the Patent Literature 1.
However, a further improvement of reliability of discharge control in an inverter device is desired.